package com.example.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBUtil {
    public static final String TABLE_USER_PASSWORD = "table_user_password";
    public static final String TABLE_USER_INFO = "table_user_info";
    public static final String SQL_DATABASE = "jdbc:mysql://101.132.244.197:3306/androidserver";

    public static Connection getConnect(){
//        com.mysql.jdbc.Driver
        Connection connection = null;
        try {
            //1、注册JDBC驱动
            Class.forName("com.mysql.jdbc.Driver");
            //2、获取数据库连接
            connection = DriverManager.getConnection(SQL_DATABASE,"root","root");
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return connection;
    }

}
